import request from '@common/utils/request';

// 获取合同列表
export function getContractList(params) {
  return request({
    url: '/contractFlows/list',
    method: 'post',
    data: params,
  });
}

// 上传文件并发起合同
export function signContractByFile(params) {
  return request({
    url: '/signContractByFile',
    method: 'post',
    data: params,
  });
}

export function createSignUrl(params) {
  return request({
    url: '/createSignUrl',
    method: 'post',
    data: params,
  });
}

export function updateContract(params) {
  return request({
    url: '/contractFlow',
    method: 'post',
    data: params,
  });
}

export function describeFlowDetailInfo(params) {
  return request({
    url: '/describeFlowDetailInfo',
    method: 'post',
    data: params,
  });
}

// 撤销签署流程
export function channelCancelFlow(params) {
  return request({
    url: '/channelCancelFlow',
    method: 'post',
    data: params,
  });
}

// h5获取我的合同列表
export function getH5ContractList(params) {
  return request({
    url: '/contracts/list',
    method: 'post',
    data: params,
  });
}


export function createH5SignUrl(params) {
  return request({
    url: '/contracts/createSignUrl',
    method: 'post',
    data: params,
  });
}

export function getFlowResourceUrls(params) {
  return request({
    url: '/contracts/getFlowResourceUrls',
    method: 'post',
    data: params,
  });
}
export function createSingleContract(params) {
  return request({
    url: '/contracts/createSingleSign',
    method: 'post',
    data: params,
  });
}

// 合同下载
export function contractDownload(params) {
  return request({
    url: '/contractFlows/download',
    method: 'post',
    data: params,
  });
}
